# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=princeprocessor
pkgver=140.4160061
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-misc')
pkgdesc='Standalone password candidate generator using the PRINCE algorithm.'
arch=('x86_64' 'aarch64')
url='https://github.com/jsteube/princeprocessor/'
license=('MIT')
depends=('lib32-glibc')
makedepends=('git' 'gcc')
source=('git+https://github.com/jsteube/princeprocessor.git')
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make pp64.bin
}

package() {
  cd $pkgname

  cd src

  install -Dm 755 pp64.bin "$pkgdir/usr/bin/$pkgname"

  cd ..

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname" rules/*
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGES
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

